import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    setSongList: sessionStorage.getItem('setSongListData') ? 1 : 0,
    SongList: sessionStorage.getItem('setSongListData') ? JSON.parse(sessionStorage.getItem('setSongListData')) : {},
    commList: sessionStorage.getItem('setCommListData') ? JSON.parse(sessionStorage.getItem('setCommListData')) : {},
    SetcommList: sessionStorage.getItem('setCommListData') ? 1 : 0,
  },
  mutations: {
    setSongList(state, info) {
      state.SongList = info
      state.setSongList = 1
    },
    SetcommList(state, info) {
      state.commList = info
      state.SetcommList = 1
    },
  },
})
